<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>资金归集(Alipay)</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" charset="utf-8" src="/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="/admin/welcomepage">首页</a>
       <a href="javascript:window.location.reload();">
          <cite>资金归集(Alipay)</cite>
        </a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:void(0);" onclick="reload_iframe();" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i>
    </a>
</div>
<div class="x-body">
    <blockquote class="layui-elem-quote">
        提示:此处为支付宝资金归集设置和记录页面,用户通过支付宝支付成功后,自动将该支付宝的资金转账到主账号中,需要账号开通单笔转账到支付宝权限!
    </blockquote>
    <fieldset class="layui-elem-field layui-col-md11 " style="margin-top: 10px;">
        <legend>资金归集设置</legend>
        <div style="height: 20px;"></div>
        <form class="layui-form layui-col-md-offset1" id="cededejlkjbgdiuwd" onsubmit="return false;">
            <input type="hidden" name="id" value="${config.id!}">
            <div class="layui-form-item">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">收款用户:</label>
                    <div class="layui-input-inline">
                        <input type="tel" name="trName" value="${config.trName!}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">收款账号:</label>
                    <div class="layui-input-inline">
                        <input type="text" value="${config.trAccount!}" name="trAccount" autocomplete="off" class="layui-input ">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">支付宝费率:</label>
                    <div class="layui-input-inline">
                        <div class="layui-input-inline">
                            <select name="settConfig" >
                                <option value="0" <%if(config.settConfig! == 0){%>selected<%}%> >用户交易费率</option>
                                <option value="1" <%if(config.settConfig! == 1){%>selected<%}%> >自定义费率</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">费率设置:</label>
                    <div class="layui-input-inline">
                        <input type="text" value="${config.sett!}" name="sett" autocomplete="off" class="layui-input ">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">转款备注:</label>
                    <div class="layui-input-inline">
                        <input type="tel" name="trDesc"  value="${config.trDesc!}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline layui-col-md5">
                    <label class="layui-form-label">状态:</label>
                    <div class="layui-input-inline">
                        <select name="status" >
                            <option value="1" <%if(config.status! == 1){%>selected<%}%> >开启</option>
                            <option value="0" <%if(config.status! == 0){%>selected<%}%> >关闭</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-col-md-offset4" onclick="grzl_submit()">保存修改</button>
                </div>
            </div>
        </form>
    </fieldset>
    <fieldset class="layui-elem-field layui-col-md11 layui-field-title" style="margin-top: 10px;" >
        <legend>资金归集记录</legend>
        <div style="height: 20px;"></div>
        <div class="layui-row">
            <form class="layui-form layui-col-md12 x-so" onsubmit="load_msg()" action="/admin/trade/edit" id="ajaxForm">
                <div class="layui-input-inline">
                    <select name="status">
                        <option  value="" <%if(status! == null){%>selected<%}%> >状态</option>
                        <option value="1" <%if(status! == 1){%>selected<%}%> >成功</option>
                        <option value="0" <%if(status! == 0){%>selected<%}%> >失败</option>
                    </select>
                </div>
                <input type="text" name="tr_name" placeholder="收款人姓名" autocomplete="off" value="${tr_name!}" class="layui-input">
                <input type="text" name="sid" placeholder="转账订单号" autocomplete="off" value="${sid!}" class="layui-input"/>
                <input type="text" name="tr_account" placeholder="收款人账号" autocomplete="off" value="${tr_account!}" class="layui-input">
                <button class="layui-btn" type="submit"><i class="layui-icon">&#xe615;</i></button>
                <span class="x-right" style="line-height:40px">共：${bean.totalNum!0} 条</span>
            </form>
        </div>
        <div id="dewdewfef">
            <%#ajax pagenode:{%>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>收款ID</th>
                    <th>收款人账号</th>
                    <th>收款人姓名</th>
                    <th>金额</th>
                    <th>状态</th>
                    <th>时间</th>
                    <th>操作</th>
                </thead>
                <tbody>
                <%for(o in bean.items!){%>
                <tr>
                    <td>${o.outOrderId!}</td>
                    <td>${o.trAccount!}</td>
                    <td>${o.trName!}</td>
                    <td>${o.trMoney!}</td>
                    <td><%if(o.status! == 1){%>成功<%}else{%>失败<%}%></td>
                    <td>${o.optTime!,dateFormat='yyyy-MM-dd HH:mm:ss'}</td>
                    <td class="td-manage">
                        <a title="详情" onclick="x_admin_show('详情','/admin/trade/view?id=${o.id!}')"
                           href="javascript:void(0);">
                            <i class="layui-icon">&#xe63c;</i>
                        </a>
                        <a title="删除" onclick="member_del(this,'${o.id!}')" href="javascript:void(0);">
                            <i class="layui-icon">&#xe640;</i>
                        </a>
                    </td>
                </tr>
                <%}%>
                </tbody>
            </table>
            <div class="page">
                <%include("/include/page.html",{context:'dewdewfef',action:'/admin/trade/edit',model:bean!}){}%>
            </div>
            <script>
                $(function () {
                    layui.use('laydate', function () {
                        var laydate = layui.laydate;
                        //执行一个laydate实例
                        laydate.render({
                            elem: '#start' //指定元素
                        });
                        //执行一个laydate实例
                        laydate.render({
                            elem: '#end' //指定元素
                        });
                    });
                });

                function member_del(obj, id) {
                    layer.confirm('确认要删除吗？', function (index) {
                        layer.load(0);
                        $.post("/admin/trade/delete",
                            {"id": id},
                            function (data) {
                            layer.closeAll();
                                layer.msg(data.msg, {icon: 1, time: 800});
                                $(obj).parents("tr").remove();
                                reload_iframe();
                            }, "json");
                    });
                }
                
                function grzl_submit() {
                    var data = $("#cededejlkjbgdiuwd").serialize();
                    layer.load(0);
                    $.post("/admin/trade/update_config",
                        data,
                        function (data) {
                            layer.closeAll();
                            layer.alert(data.msg, {icon: 6}, function () {
                                reload_iframe();
                            });
                        }, "json");
                }


                window.onload  = close_loading_msg();

                function reload_iframe() {
                    parent.obj = parent.layer.load(0);
                    location.replace(location.href);
                }

            </script>
            <%}%>
        </div>
    </fieldset>
</div>
</body>
</html>